package cn.school.service;

import org.apache.ibatis.session.SqlSession;

import cn.school.dao.StudentDao;
import cn.school.entity.Student;
import cn.school.util.MyBatisUtil;

public class Service4 {
	public int add(Student stu) {
		SqlSession session = MyBatisUtil.getSqlsession();
		try {
			StudentDao studentDao = session.getMapper(StudentDao.class);
			return studentDao.add(stu);
		} finally {
			MyBatisUtil.getclose(session);
		}
	}
}
